#!/bin/bash

echo "========================================"
echo "设置Gitee远程仓库"
echo "========================================"

# 设置Git配置
git config --global core.quotepath false
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8

echo "1. 检查当前状态..."
git status

echo ""
echo "2. 添加所有文件..."
git add .

echo ""
echo "3. 提交更改..."
git commit -m "feat: implement log file preview functionality

- Add LogView component for log file selection and preview
- Add /logs/files and /logs/content API endpoints
- Support UTF-8 encoding and line count control
- Improve error handling and responsive design"

echo ""
echo "4. 配置Gitee远程仓库..."
# 请替换为您的实际Gitee用户名和仓库名
GITEE_USERNAME="your-username"
REPO_NAME="lemon-process"
GITEE_URL="https://gitee.com/${GITEE_USERNAME}/${REPO_NAME}.git"

# 移除现有的gitee远程仓库（如果存在）
git remote remove gitee 2>/dev/null

# 添加Gitee远程仓库
git remote add gitee ${GITEE_URL}

echo ""
echo "5. 推送到Gitee..."
echo "使用令牌进行身份验证..."
git push -u gitee master

echo ""
echo "========================================"
echo "发布完成！"
echo "========================================"
echo "请访问 https://gitee.com/${GITEE_USERNAME}/${REPO_NAME} 查看代码"
echo "========================================"
